package com.atguigu.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.Arrays;
import java.util.Map;

@Controller

public class HelloController {


@RequestMapping({"/","/index.html"})
    public String index(){

        return "login";
    }
//@ResponseBody
//    @RequestMapping("/hello")
//    public String hello(){
//
//    return "hello  World";
//}
//查出一些数据，在页面展示

@RequestMapping("/success")
    public String success(Map<String,Object>map){
//    view.addObject("hello","你好");
//    view.addObject("users", Arrays.asList("zhangsan","lisi","wangwu"));
//    view.setViewName("successqw");
    map.put("hello","<h1>你好</h1>");
    map.put("users", Arrays.asList("张三","李四","黄渤"));

    //classpath:/templates/
    return "successqw";

}

}
